import { PrismaClient, Prisma } from "@prisma/generated-client";

let config: Prisma.PrismaClientOptions | undefined;

if (process.env.APP_DEBUG === "true") {
  config = {
    log: [
      {
        level: "query", // 记录查询日志
        emit: "stdout", // 以控制台打印的形式
      },
    ],
  };
}

const prisma = new PrismaClient(config);

export default prisma;
